import request from "../common/request";

/*
* 这里放的是一些临时配置
*/
export function getConfig(){
    return request({
      url: 'dragon/config',
      methods: 'GET',
	  //baseUrl: url,
	  useDefaultWallet: false,
    })
}

/*
* 检查版本
*/
export function getVersion(){
    return request({
      url: 'dragon/version_apk',
      methods: 'GET',
	  //baseUrl: url,
    })
}

//下方内容已经废弃
const url = 'http://8.135.35.171:3000/index.php/api/';

/**
 * 获取合约列表
 * address
*/
export function getTokenList(address=''){
    return request({
      url: 'dragon/tokenList?address='+ address,
      methods: 'GET',
	  baseUrl: url,
    })
}

/**
 * 获取短信(临时通知，在3月7废弃)
 * address
*/
export function getSms(address=''){
    return request({
      url: 'dragon/getSms?address='+ address,
      methods: 'GET',
	  baseUrl: url,
    })
}

/**
 * 获取真正短信验证码（绑定旧数据用途）
 * address
 * mobile
*/
export function getMobileCode(address,mobile){
    return request({
      url: 'dragon/getMobileCode?address='+ address +'&mobile='+mobile,
      methods: 'GET',
	  baseUrl: url,
    })
}
/**
 * 填入短信验证码
 * address
 * mobile
 * code
*/
export function mobileFindData(address,mobile,code){
    return request({
      url: 'dragon/mobileFindData?address='+ address + '&mobile=' + mobile + '&code=' + code,
      methods: 'GET',
	  baseUrl: url,
    })
}

/**
 * 二次确认
 * address
 * mobile
*/
export function verifyDone(address,mobile){
    return request({
      url: 'dragon/verifyDone?address='+ address + '&mobile=' + mobile,
      methods: 'GET',
	  baseUrl: url,
    })
}

/**
 * 根据用户地址查询旧数据
*/
export function findByAddress(address){
    return request({
      url: 'dragon/findByAddress?address=' + address,
      methods: 'GET',
	  baseUrl: url,
    })
}